//
//  ViewController.m
//  Block传值~demo
//
//  Created by 石虎 on 2017/9/22.
//  Copyright © 2017年 石虎. All rights reserved.
//

#import "ViewController.h"
#import "SHBlockViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *blockLabel;
- (IBAction)blockClick:(UIButton *)sender;

@end

@implementation ViewController

//逆向传值
- (IBAction)blockClick:(UIButton *)sender {
    
    SHBlockViewController *blockVC =[[SHBlockViewController alloc] init];
    // 接收方只需要调用传输方的 block 方法
    [blockVC showTheResultToFirst:^(NSString *secondString) {
        self.blockLabel.text = secondString;
    }];
    [self presentViewController:blockVC animated:YES completion:nil];

}
- (void)viewDidLoad {
    [super viewDidLoad];
    
}
@end
